//
//  ExperienceVoucher.m
//  GoodWayClient
//
//  Created by HuiDong on 15/12/22.
//  Copyright © 2015年 HuiDong. All rights reserved.
//

#import "ExperienceVoucher.h"

@implementation ExperienceVoucher

+ (instancetype)ExperienceVoucherWithDic:(NSDictionary *)dic
{
    return [[self alloc] initWithDic:dic];
}
- (instancetype)initWithDic:(NSDictionary *)dic
{
    if (self = [super init]) {
        NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
        self.experienceVoucherId = [[numberFormatter stringFromNumber:dic[@"Id"]] intValue];
        self.blueSkyAngelId = [[numberFormatter stringFromNumber:dic[@"Uid"]] intValue];
        self.CardNum = dic[@"CardNum"];
        self.MaxNum = [[numberFormatter stringFromNumber:dic[@"MaxNum"]] intValue];
        self.UsedNum = [[numberFormatter stringFromNumber:dic[@"UsedNum"]] intValue];
        self.BeginTime = (NSDate *)dic[@"BeginTime"];
        self.EndTime = (NSDate *)dic[@"EndTime"];
        self.Description = dic[@"Description"];//系统有这个，会不会造成冲突
        self.Money = [[numberFormatter stringFromNumber:dic[@"Money"]] doubleValue];
        self.Status = [[numberFormatter stringFromNumber:dic[@"Status"]] intValue];
    }
    return self;
}

@end
